
*Coding: Post-Brexit Relations 

gen Trade_invest=q8
gen Sec_defense=q9
gen Energy=q10
gen Env_climate=q11
recode Trade_invest Sec_defense Energy Env_climate (1=2)(2=0)(77=1)

gen Future_relationship1=(Trade_invest + Sec_defense + Energy + Env_climate)*(10/8)

*Coding: Sympathy for Brexit

gen Brexit=q7
recode Brexit (1=4)(2=3)(77=2)(3=1)(4=0)
replace Brexit=Brexit*(10/4)

**Coding: Independent Variables

gen Oldest=age
recode Oldest (1/2=0)(3=1)

gen Middle_age=age
recode Middle_age (1=0)(2=1)(3=0)

gen Youngest=age
recode Youngest (1=1)(2/3=0)

gen Female=gender
recode Female (1=0)(2=1)

recode University_degree (1=1)(2=0)

recode Income_high (1=1)(2=0)

gen Atlantic=region
recode Atlantic (1=1)(2/7=0)

gen Quebec=region
recode Quebec (1=0)(2=1)(3/7=0)

gen Ontario=region
recode Ontario (1/2=0)(3=1)(4/7=0)

gen Prairies=region
recode Prairies (1/3=0)(4=1)(7=0)

gen BC=region
recode BC (1/4=0)(7=1)

gen Europe_affinity=0
replace Europe_affinity=1 if q1r1==5
replace Europe_affinity=.5 if q1r2==5

gen UK_affinity=Q2_UK_Affinity
recode UK_affinity (1=1)(2=0)

gen Rules=0
replace Rules=1 if q3r1==5
replace Rules=.5 if q3r2==5

gen Liberal=q12
recode Liberal (1=1)(2/77=0)

gen Conservative=q12
recode Conservative (1=0)(2=1)(3/77=0)

gen NDP=q12
recode NDP (1/2=0)(3=1)(4/77=0)

gen Bloc=q12
recode Bloc (1/3=0)(4=1)(5/77=0)

gen Other=q12
recode Other (1/4=0)(5/77=1)

gen Pro_referendum=q4
recode Pro_referendum (1=1)(2=0)(3=.5)

gen Pro_EU=q5
recode Pro_EU (1=4)(2=3)(77=2)(3=1)(4=0)
replace Pro_EU=Pro_EU/4

gen Brexit_knowledge=q6
recode Brexit_knowledge (1=1)(2/3=0)

gen know_Conservative=Brexit_knowledge*Conservative

gen know_NDP=Brexit_knowledge*NDP

gen know_Bloc=Brexit_knowledge*Bloc

gen know_Other=Brexit_knowledge*Other


*Reliability Analysis for Post-Brexit Relations Index

alpha Trade_invest Sec_defense Energy Env_climate, item


*Exploratory Factor Analysis for Post-Brexit Relations Index

polychoric Trade_invest Sec_defense Energy Env_climate

display r(sum_w)

global N = r(sum_w)

matrix r = r(R)
factormat r, n($N) factors(2)
(obs=1013)


*Confirmatory Factor Analysis for Post-Brexit Relations Index

gsem (Future ->  Sec_defense Trade_invest Energy Env_climate ), pweights(weight) ologit latent(Future)


*Table 1

svyset [pweight=weight]
svy: tab q8 
svy: tab q9 
svy: tab q10 
svy: tab q11


*Table 2, Model 1

regress Brexit Female Middle_age Oldest Income_high University_degree Atlantic Quebec Prairies BC [pweight=weight]
fitstat


*Table 2, Model 2

regress Brexit Female Middle_age Oldest Income_high University_degree Atlantic Quebec Prairies BC Europe_affinity  UK_affinity Rules [pweight=weight]
fitstat


*Table 2, Model 3

regress Brexit Female Middle_age Oldest Income_high University_degree Atlantic Quebec Prairies BC Europe_affinity  UK_affinity Rules Conservative NDP Bloc Other [pweight=weight]
fitstat


*Table 2, Model 4

regress Brexit Female Middle_age Oldest Income_high University_degree Atlantic Quebec Prairies BC Europe_affinity  UK_affinity Rules Conservative NDP Bloc Other Pro_referendum  [pweight=weight]
fitstat


*Table 3, Model 1


regress Future_relationship1 Female Middle_age Oldest Income_high University_degree Atlantic Quebec Prairies BC  [pweight=weight]
fitstat


*Table 3, Model 2

regress Future_relationship1 Female Middle_age Oldest Income_high University_degree Atlantic Quebec Prairies BC Europe_affinity  UK_affinity Rules [pweight=weight]
fitstat


*Table 3, Model 3


regress Future_relationship1 Female Middle_age Oldest Income_high University_degree Atlantic Quebec Prairies BC Europe_affinity  UK_affinity Rules Conservative NDP Bloc Other  [pweight=weight]
fitstat


*Table 4, Model 1

regress Brexit Female Middle_age Oldest Income_high University_degree Atlantic Quebec Prairies BC Europe_affinity  UK_affinity Rules Conservative NDP Bloc Other Brexit_knowledge [pweight=weight]
fitstat


*Table 4, Model 2


regress Brexit Female Middle_age Oldest Income_high University_degree Atlantic Quebec Prairies BC Europe_affinity  UK_affinity Rules Conservative NDP Bloc Other Brexit_knowledge know_Conservative know_NDP know_Bloc know_Other [pweight=weight]
fitstat


*Table 4, Model 3

regress Future_relationship1 Female Middle_age Oldest Income_high University_degree Atlantic Quebec Prairies BC Europe_affinity  UK_affinity Rules Conservative NDP Bloc Other Brexit_knowledge [pweight=weight]
fitstat


*Table 4, Model 4

regress Future_relationship1 Female Middle_age Oldest Income_high University_degree Atlantic Quebec Prairies BC Europe_affinity  UK_affinity Rules Conservative NDP Bloc Other Brexit_knowledge know_Conservative know_NDP know_Bloc know_Other [pweight=weight]
fitstat


*Table 4, Model 5

regress Future_relationship1 Female Middle_age Oldest Income_high University_degree Atlantic Quebec Prairies BC Europe_affinity  UK_affinity Rules Conservative NDP Bloc Other Brexit_knowledge know_Conservative know_NDP know_Bloc know_Other Pro_EU [pweight=weight]
fitstat




